define(["jquery", "easy-admin","treetable"], function ($, ea) {

    var table = layui.table,
        treetable = layui.treetable;
    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'mall.withdrawal/index',
        tixian_url:'mall.withdrawal/tixian',
        edit_url:'mall.withdrawal/edit'
    };

    var Controller = {
        index: function () {
            ea.table.render({
                init: init,
                height:'full-50',
                toolbar: ['refresh',
                    [],
                ],
                cols: [[
                    {type: "checkbox"},
                    {field: 'id', width: 80, title: 'ID'},
                    {field: 'nickName', minWidth: 80, title: '用户昵称'},
                    {field: 'money', minWidth: 100, title: '提现金额'},
                    {field: 'dotype', minWidth: 80,title: '打款方式',search: 'select', selectList: {0: '--', 1: '自动打款',2:'手动打款'}},
                    {field: 'status', minWidth: 80,title: '状态', selectList: {0: '待审核', 1: '提现成功',2:'拒绝提现'}},
                    {field: 'create_time', minWidth: 80, title: '申请时间', search: 'range'},
                    {
                        width: 200,
                        title: '操作',
                        templet: ea.table.tool,
                        operat: [
                            [{
                                text: '审核',
                                url: init.tixian_url,
                                method: 'open',
                                auth: 'edit',
                                class: 'layui-btn layui-btn-xs layui-btn-success',
                                extend: 'data-full="true"',
                            }],
                        ]
                    },
                ]],
            });
            ea.listen();
        },
        edit: function (){
            ea.listen()
        },
        tixian: function (){
            ea.listen()
        }
    };
    return Controller;
});